<!-- 
	动态组件：富文本 组件
	props: 
		data: 组件数据
		
	action:
		
 -->
<template>
    <view class="dynamic-editor" v-if="isShow" :style="{ background: data.EditorBgColor }">
        <rich-text :nodes="data.EditorContent" v-if="loadOk"></rich-text>
    </view>
</template>

<script>
import { formatRichText } from "@/uni-sub-base/utils/elementUtil.js"
export default {
    props: {
        datas: {
            type: Array,
            default: () => [],
        },
        data: {
            type: Object,
            default: () => {},
        },
    },
    data() {
        return {
            isShow: true,
            loadOk: false,
        }
    },
    mounted() {
        let text = "组合搜索组件和轮播图"
        if (this.data.EditorContent.includes(text)) {
            this.$emit("mixSearchBanner", true)
            this.isShow = false
        }
        this.$emit("loadBack", this.data.index)
        this.loadOk = true
    },
    methods: {
        formatRichTextFn(text) {
            return formatRichText(text)
        },
    },
}
</script>

<style lang="scss" scope>
@import "@/uni-sub-base/components/dynamic/style/dynamic.scss";
.s {
    display: inline-block;
    float: left;
}
</style>
